package com.qj.daibei.controller;

import com.github.pagehelper.PageInfo;
import com.qj.daibei.pojo.Overdue;
import com.qj.daibei.pojo.User;
import com.qj.daibei.service.OverdueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

/**
 * author wml
 * Created on 2021/10/28 20:57
 */
@Controller
public class OverdueController {

    @Autowired
    private OverdueService overdueService;

    @RequestMapping(value = "findOverdueAndShouldPayBackByPage", method = RequestMethod.GET)
    @ResponseBody
    public PageInfo<Overdue> findOverdueAndShouldPayBackByPage(int pageNum, HttpSession session) {
        User user = (User) session.getAttribute("loginUser");
        return this.overdueService.findOverdueAndShouldPayBackByPage(pageNum, user.getUserId());
    }
}
